<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改房产资产')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-house-edit" th:object="${tLandHouseAssets}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">土地资产名称：</label>
                <div class="col-sm-3">
                    <select name="landAssetsId" class="form-control"  th:with="type=${@TLandAssetsServiceImpl.getlandAssetsId()}">
                        <option th:field="*{landAssetsId}" th:each="land : ${type}" th:text="${land.name}" th:value="${land.id}"></option>
                    </select>
                </div>
                <label class="col-sm-3 control-label is-required">资产用途：</label>
                <div class="col-sm-3">
                    <select name="purpose" id="purpose" class="form-control" th:with="type=${@dict.getType('house_purpose')}" required>
                        <option >请选择...</option>
                        <option th:field="*{purpose}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">资产编号：</label>
                <div class="col-sm-3">
                    <input name="code" th:field="*{code}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-3 control-label is-required">资产名称：</label>
                <div class="col-sm-3">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">资产地址：</label>
                <div class="col-sm-3">
                    <input name="address" th:field="*{address}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-3 control-label is-required">区域位置：</label>
                <div class="col-sm-3">
                    <input name="position" th:field="*{position}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">使用状态：</label>
                <div class="col-sm-3">
                    <select name="state" class="form-control" th:with="type=${@dict.getType('house_state')}" required>
                        <option >请选择...</option>
                        <option th:field="*{state}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
                <label class="col-sm-3 control-label is-required">竣工时间：</label>
                <div class="col-sm-3">
                    <div class="input-group date">
                        <input name="completedTime" th:value="${#dates.format(tLandHouseAssets.completedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">楼层分布：</label>
                <div class="col-sm-3">
                    <input name="distribute" th:field="*{distribute}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-3 control-label is-required">建筑面积：</label>
                <div class="col-sm-3">
                    <input name="acreage" th:field="*{acreage}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">房屋结构：</label>
                <div class="col-sm-3">
                    <input name="structure" th:field="*{structure}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-3 control-label is-required">修建年代：</label>
                <div class="col-sm-3">
                    <input name="buildingTime" th:field="*{buildingTime}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">建设单位：</label>
                <div class="col-sm-3">
                    <input name="buildingCompany" th:field="*{buildingCompany}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">管理单位：</label>
                <div class="col-sm-3">
                    <input name="adminCompany" th:field="*{adminCompany}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">完好等级：</label>
                <div class="col-sm-3">
                    <input name="level" th:field="*{level}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">是否整体交付：</label>
                <div class="col-sm-3">
                    <div class="radio-box" th:field="*{overallDelivery}" th:each="dict : ${@dict.getType('overall_delivery')}">
                        <input type="radio" th:id="${'overallDelivery_' + dict.dictCode}" name="overallDelivery" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'overallDelivery_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">未交付原因：</label>
                <div class="col-sm-3">
                    <input name="noDeliveryCause" th:field="*{noDeliveryCause}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">容积率：</label>
                <div class="col-sm-3">
                    <input name="plotRatio" th:field="*{plotRatio}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">产权证号：</label>
                <div class="col-sm-3">
                    <input name="propertyRightCard" th:field="*{propertyRightCard}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">使用期限：</label>
                <div class="col-sm-3">
                    <input name="deadline" th:field="*{deadline}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">证书登记日期：</label>
                <div class="col-sm-3">
                    <div class="input-group date">
                        <input name="cardRecordDate" th:value="${#dates.format(tLandHouseAssets.cardRecordDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
                <label class="col-sm-3 control-label">证件位置：</label>
                <div class="col-sm-3">
                    <input name="cardPlace" th:field="*{cardPlace}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">经度：</label>
                <div class="col-sm-3">
                    <input name="longitude" th:field="*{longitude}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">纬度：</label>
                <div class="col-sm-3">
                    <input name="latitude" th:field="*{latitude}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">测绘机构：</label>
                <div class="col-sm-3">
                    <input name="surveyCompany" th:field="*{surveyCompany}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">商业用途:</label>
                <div class="col-sm-3">
                    <select name="commercialPurpose" class="form-control" th:with="type=${@dict.getType('commercial_purpose')}" required>
                        <option >请选择...</option>
                        <option th:field="*{commercialPurpose}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>

            <div id="isShow" th:if="${tLandHouseAssets.purpose} == 3">
                <div class="form-group">
                    <label class="col-sm-3 control-label">车位数量：</label>
                    <div class="col-sm-3">
                        <input name="parkingLotAmount" th:field="*{parkingLotAmount}" class="form-control" type="text">
                    </div>
                    <label class="col-sm-3 control-label">出租车位：</label>
                    <div class="col-sm-3">
                        <input name="parkingLotUsed" th:field="*{parkingLotUsed}" class="form-control" type="text">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">闲置车位：</label>
                    <div class="col-sm-3">
                        <input name="parkingLotRemanent" th:field="*{parkingLotRemanent}" class="form-control" type="text">
                    </div>
                    <label class="col-sm-3 control-label">已使用面积：</label>
                    <div class="col-sm-3">
                        <input name="usedAcreage" th:field="*{usedAcreage}" class="form-control" type="text">
                    </div>
                </div>
            </div>

            <div id="isShow3" hidden="true">
                <div class="form-group">
                    <label class="col-sm-3 control-label">车位数量：</label>
                    <div class="col-sm-3">
                        <input name="parkingLotAmount" th:field="*{parkingLotAmount}" class="form-control" type="text">
                    </div>
                    <label class="col-sm-3 control-label">出租车位：</label>
                    <div class="col-sm-3">
                        <input name="parkingLotUsed" th:field="*{parkingLotUsed}" class="form-control" type="text">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">闲置车位：</label>
                    <div class="col-sm-3">
                        <input name="parkingLotRemanent" th:field="*{parkingLotRemanent}" class="form-control" type="text">
                    </div>
                    <label class="col-sm-3 control-label">已使用面积：</label>
                    <div class="col-sm-3">
                        <input name="usedAcreage" th:field="*{usedAcreage}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">层高：</label>
                <div class="col-sm-3">
                    <input name="floorHeight" th:field="*{floorHeight}" class="form-control" type="text">
                </div>
                <label class="col-sm-3 control-label">承重能力(kg/m^2)：</label>
                <div class="col-sm-3">
                    <input name="bearingCapacity" th:field="*{bearingCapacity}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" th:field="*{remark}" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "house/house";
        $("#form-house-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-house-edit').serialize());
            }
        }

        $("input[name='completedTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='cardRecordDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("#purpose").change(function() {
            var purpose = $("#purpose").val();
            if (purpose != 3) {
                $("#isShow").css('display','none');
                $("#isShow3").attr("hidden",true);
            }else {
                $("#isShow3").attr("hidden",false);
            }

        })
    </script>
</body>
</html>